MESSAGE:New("服务器清理模块加载完毕", 10, "服务器资源:", true):ToAll()
local function serverCleaner()

	local unitPrefix = "Cargo Group"
	local staticPrefix = "Cargo Static"
	local soldierPrefix = "Soldier_Group_"

	-- 静态资源
	local staticset = SET_STATIC:New()
					:FilterPrefixes(staticPrefix)
					:FilterStart()

	if staticset == nil then
		MESSAGE:New("未找到！", 10, "DEBUG"):ToAll()
	else
		staticset:ForEachStatic(
		function( cargo )
			if cargo ~= nil then
				cargo:Destroy()
				MESSAGE:New("服务器空投静态资源已经清理完毕.", 10, "服务器资源:"):ToAll()
			else
				MESSAGE:New("未找到服务器资源", 10, "服务器资源:"):ToAll()
			end
		end
		)

	end


	local groupset = SET_GROUP:New()
					:FilterPrefixes({unitPrefix, soldierPrefix})
					:FilterStart()
	if groupset == nil then
		MESSAGE:New("未找到！", 10, "bug", true):ToAll()
	else
		groupset:ForEachGroup(
		function( cargo )
			if cargo ~= nil then
				cargo:Destroy()
				MESSAGE:New("服务器空投物资已经清理完毕.", 10, "服务器资源:", true):ToAll()
			else
				MESSAGE:New("未找到服务器资源", 10, "服务器资源:", true):ToAll()
			end
		end
		)

	end
end

MENU_COALITION_COMMAND:New(coalition.side.RED, "服务器清理", nil, serverCleaner)

env.setErrorMessageBoxEnabled(false)